<%--
  Created by IntelliJ IDEA.
  User: Alta Y
  Date: 2019/10/7
  Time: 0:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>采购执行列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />

    <link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.min.css" />
    <script src="js/jquery.min.js"></script>
    <link rel="stylesheet" href="css/font.css">
    <link rel="stylesheet" href="css/xadmin.css">
    <!-- <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> -->
    <script src="lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/xadmin.js"></script>

    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .page .pagination li{
            margin: 0;
            float: left;
        }
        .page .pagination li span{
            padding: 0;
            border: none;
        }
    </style>
</head>

<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                <a href="">采购执行管理</a>
                <a>
                    <cite>查询采购执行订单</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
    </a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">


                <div class="layui-card-body " style="padding-top: 16px;">
                    <form class="layui-form layui-col-space5" style="margin-bottom: 10px;" action="/executionList">

                        <div class="layui-input-inline layui-show-xs-block">
                            <input class="layui-input" placeholder="单据编号" name="bill_number" ></div>
                        <div class="layui-input-inline layui-show-xs-block">
                            <select name="exec_state" lay-verify="">
                                <option value="">请选择采购单状态</option>
                                <option value="1">已下达</option>
                                <option value="2">已提交</option>
                                <option value="3">已发布</option>
                                <%--<option value="3">已驳回</option>--%>
                                <option value="4">已作废</option>
                            </select>
                        </div>
                        <div class="layui-input-inline layui-show-xs-block">
                            <button class="layui-btn" lay-submit="" lay-filter="sreach" style="margin-top: 0;">
                                <i class="layui-icon">&#xe615;</i>搜索</button>
                        </div>
                    </form>

                    <div class="layui-col-md12" style="margin-bottom: 10px;">
                        <div class="layui-card">

                            <!-- <div class="layui-card-body "> -->
                            <table class="layui-table gonggaotable">
                                <colgroup>
                                    <col>
                                    <col>
                                    <col>
                                    <col>
                                    <col>
                                    <col>
                                    <col>
                                    <col>
                                    <col>
                                </colgroup>
                                <thead>
                                <tr>
                                    <th>id</th>
                                    <th>单据编号</th>
                                    <th>煤种</th>
                                    <th>采购数量（万吨）</th>
                                    <th>收到基低位发热量</th>
                                    <th>运输方式</th>
                                    <th>下达日期</th>
                                    <th>订单状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <c:forEach items="${pageInfo.list}" var="exec">
                                    <tr>
                                        <td>${exec.apply_id}</td>
                                        <td>${exec.bill_number}</td>
                                        <td>
                                            <c:if test="${exec.coal_type == 5}">其他</c:if>
                                            <c:if test="${exec.coal_type == 1}">烟煤</c:if>
                                            <c:if test="${exec.coal_type == 2}">无烟煤</c:if>
                                            <c:if test="${exec.coal_type == 3}">褐煤</c:if>
                                            <c:if test="${exec.coal_type == 4}">贫瘦煤</c:if>
                                        </td>
                                        <td>${exec.qty}</td>
                                        <td>${exec.type_1}</td>
                                        <td>
                                            <c:if test="${exec.transport_mode == 1}">火车</c:if>
                                            <c:if test="${exec.transport_mode == 2}">汽车</c:if>
                                            <c:if test="${exec.transport_mode == 3}">船运</c:if>
                                            <c:if test="${exec.transport_mode == 4}">其他</c:if>
                                        </td>
                                        <td><fmt:formatDate value="${exec.write_date}" pattern="yyyy-MM-dd" /> </td>
                                        <td>
                                            <c:if test="${exec.exec_state == 1}">已下达</c:if>
                                            <c:if test="${exec.exec_state == 2}">已提交</c:if>
                                            <c:if test="${exec.exec_state == 3}">已发布</c:if>
                                            <c:if test="${exec.exec_state == 4}">已作废</c:if>
                                        </td>
                                        <td class="td-manage">
                                            <!-- 点击跳转到procurement-edit.html -->
                                            <c:if test="${exec.exec_state == 1}">
                                                <a title="填报"  onclick="" href="/executionFill?apply_id=${exec.apply_id}" >
                                                    <i class="layui-icon">&#xe642;</i>填报&thinsp; &thinsp; &thinsp;
                                                </a>
                                            </c:if>

                                            <c:if test="${exec.exec_state == 2}">
                                                <a title="查看"  onclick="" href="/executionView?apply_id=${exec.apply_id}">
                                                    <i class="layui-icon">&#xe67b;</i>查看&thinsp; &thinsp; &thinsp;
                                                </a>
                                            </c:if>

                                            <c:if test="${exec.exec_state == 3}">
                                                <a title="查看"  onclick="" href="/executionView?apply_id=${exec.apply_id}">
                                                    <i class="layui-icon">&#xe67b;</i>查看&thinsp; &thinsp; &thinsp;
                                                </a>
                                            </c:if>

                                            <c:if test="${exec.exec_state == 4}">已作废</c:if>
                                        </td>
                                    </tr>
                                </c:forEach>
                                <%--<tr>
                                    <td>1</td>
                                    <td>中能热电-2015-06-015</td>
                                    <td>烟煤</td>
                                    <td>5.00</td>
                                    <td>5200</td>
                                    <td>船运</td>
                                    <td>2019-05-15</td>
                                    <td>已驳回</td>
                                    <td class="td-manage">
                                        <!-- 点击跳转到procurement-edit.html -->
                                        <a title="填报"  onclick="" href="/executionFill">
                                            <i class="layui-icon">&#xe642;</i>填报&thinsp; &thinsp; &thinsp;
                                        </a>
                                        <a title="作废" onclick="member_del(this,'要作废的id')" href="javascript:;">
                                            <i class="layui-icon">&#xe640;</i>作废
                                        </a>
                                    </td>
                                </tr>--%>
                                </tbody>
                            </table>
                            <!-- </div> -->
                        </div>
                    </div>
                    <!-- 列表结束 -->
                    <footer class="page">
                        <div class="row">

                            <!--点击分页-->
                            <div class="col-md-12">
                                <nav aria-label="Page navigation">
                                    <ul class="pagination" style="margin-bottom: 0;margin-top: 10px;">

                                        <li><a href="${pageContext.request.contextPath}/executionList?pn=1&bill_number=${keywords[0]}&exec_state=${keywords[1]}">首页</a></li>

                                        <!--上一页-->
                                        <li>
                                            <c:if test="${pageInfo.hasPreviousPage}">
                                                <a href="${pageContext.request.contextPath}/executionList?pn=${pageInfo.pageNum-1}&bill_number=${keywords[0]}&exec_state=${keywords[1]}" aria-label="Previous">
                                                    <span aria-hidden="true">«</span>
                                                </a>
                                            </c:if>
                                        </li>

                                        <!--循环遍历连续显示的页面，若是当前页就高亮显示，并且没有链接-->
                                        <c:forEach items="${pageInfo.navigatepageNums}" var="page_num">
                                            <c:if test="${page_num == pageInfo.pageNum}">
                                                <li class="active"><a href="#">${page_num}</a></li>
                                            </c:if>
                                            <c:if test="${page_num != pageInfo.pageNum}">
                                                <li><a href="${pageContext.request.contextPath}/executionList?pn=${page_num}&bill_number=${keywords[0]}&exec_state=${keywords[1]}">${page_num}</a></li>
                                            </c:if>
                                        </c:forEach>

                                        <!--下一页-->
                                        <li>
                                            <c:if test="${pageInfo.hasNextPage}">
                                                <a href="${pageContext.request.contextPath}/executionList?pn=${pageInfo.pageNum+1}&bill_number=${keywords[0]}&exec_state=${keywords[1]}"
                                                   aria-label="Next">
                                                    <span aria-hidden="true">»</span>
                                                </a>
                                            </c:if>
                                        </li>

                                        <li><a href="${pageContext.request.contextPath}/executionList?pn=${pageInfo.pages}&bill_number=${keywords[0]}&exec_state=${keywords[1]}">尾页</a></li>
                                    </ul>
                                </nav>
                            </div>
                            <!--文字信息-->
                            <div class="col-md-12">
                                当前第 ${pageInfo.pageNum} 页.总共 ${pageInfo.pages} 页.一共 ${pageInfo.total} 条记录
                            </div>

                        </div>
                    </footer>
                </div>
                <!-- 分页 -->
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['form'], function(){
        form = layui.form;

    });

    /*公告-删除*/
    function member_del(obj,id){
        layer.confirm('确认要作废吗？',function(index){
            //发异步删除数据
            $(obj).parents("tr").remove();
            layer.msg('已作废!',{icon:1,time:1000});
        });
    }
</script>
</body>
</html>

